#ifndef TEXTWIDGET_H
#define TEXTWIDGET_H
#include <QVBoxLayout>
#include <QWidget>
#include <QCheckBox>
#include <QRadioButton>
#include <QLineEdit>
#include <QClipboard>
namespace dymy
{
    class Text;
}
class TextWidget : public QWidget
{
    Q_OBJECT
public:
    explicit TextWidget(QWidget *parent = nullptr);
    bool isFontFamilyChecked();
    float getScale();
signals:

private:
    QVBoxLayout *container;
    QCheckBox *fontFamilyCheckbox;
    QLineEdit *scaleLineEdit;
};

class TextPopup : public QWidget
{


    Q_OBJECT
public:
    enum Type{
        kCancel,
        kContinue,
        kCopyStyle,
        kCopyText,
    };
    explicit TextPopup(QWidget *parent, dymy::Text *textPtr);

    void closeEvent(QCloseEvent *event) override;
    ~TextPopup();
signals:
    void onClosed(Type type);
private slots:
    void on_clipboard_datachanged();

private:
    QString code;
    QClipboard *clipboard;
    dymy::Text *textPtr;
    Type type;
};

#endif // TEXTWIDGET_H
